<?php
session_start();
?>


<?php
ini_set('session.bug_compat_warn', 0);
ini_set('session.bug_compat_42', 0);

$username = $_SESSION['username'];
if($username==null || $username== ""|| $username == "")
{
	header('Location: http://172.26.195.159/checklist/php/logout.php');
}
?>

<?php require_once('../KLogger.php');
$log = new KLogger ( "log.txt" , KLogger::DEBUG );
?>

<?php
//Fetch session variables
$id=$_SESSION['id'];
//Fetching the variables

$title = $_REQUEST['title'];
$description = $_REQUEST['description'];

$root_cause = $_REQUEST['root_cause'];
$solution = $_REQUEST['solution'];

$view_name = $_REQUEST['view_name'];
$activity_name = $_REQUEST['activity_name'];

$patch_name = $_REQUEST['patch_name'];

$parcel_name = $_REQUEST['parcel_name'];
$compile_dir = $_REQUEST['compile_dir'];
$package_dir = $_REQUEST['package_dir'];
$build_target = $_REQUEST['build_target'];

//$checklist_reviewer = $_REQUEST['checklist_reviewer'];
//$pl = $_REQUEST['pl'];
//$pm =  $_REQUEST['pm'];

$patching_guidelines =  $_REQUEST['patching_guidelines'];

//$dp_prime =   $_REQUEST['dp_prime'];

$baseline =  $_REQUEST['baseline'];
$milestone =  $_REQUEST['milestone'];
$line_of_code  =  $_REQUEST['line_of_code'];

//$domain = $_REQUEST['domain'];

$internal_idce_number = $_REQUEST['internal_idce_number'];

//$internal_idce_reviewer = $_REQUEST['internal_idce_reviewer'];

$external_idce_number = $_REQUEST['external_idce_number'];

//$external_idce_reviewer = $_REQUEST['external_idce_reviewer'];



//Creating a connection.

$con = mysql_connect("localhost","root","");
mysql_select_db("checklist", $con);

//Creating escaped Strings : 20/02/2012 
$title_escaped = mysql_real_escape_string($title);
$description_escaped = mysql_real_escape_string($description);
$root_cause_escaped = mysql_real_escape_string($root_cause);
$solution_escaped = mysql_real_escape_string($solution);


//insert in cr
$sql_1 = "update cr set title='$title_escaped' ,description='$description_escaped' , root_cause='$root_cause_escaped' ,solution='$solution_escaped' , view_name='$view_name' , activity_name='$activity_name' , patch_name='$patch_name' , parcel_name='$parcel_name' , compile_dir='$compile_dir'
, package_dir='$package_dir' , build_target='$build_target'  , patching_guidelines='$patching_guidelines' , baseline='$baseline' , milestone='$milestone' , line_of_code=$line_of_code , internal_idce_number=$internal_idce_number  , external_idce_number=$external_idce_number where id='$id'";

mysql_query($sql_1,$con) or die('Error: ' . mysql_error());

$log->logInfo('In updateCrDetails[77] : '.$username);
$log->logInfo('In updateCrDetails[78] : '.$id);

echo '<script type="text/javascript">','alert("CR Details Successfully Updated.");',
'window.location = "http://172.26.195.159/checklist/php/mainpage.php";' ,'</script>';
	

?>

